//
//  UILabel+Chained.m
//  ObjectCChained
//
//  Created by sny on 2018/5/18.
//  Copyright © 2018年 HuangYangYang. All rights reserved.
//

#import "UILabel+Chained.h"

@implementation UILabel (Chained)

- (UILabel *(^)(NSString *,UIColor *,UIFont *))chianedTextSet {
    return ^UILabel *(NSString *text,UIColor *textColor,UIFont *textFont) {
        if (text) {self.text = text;}
        if (textColor) {self.textColor = textColor;}
        if (textFont) {self.font = textFont;}
        return self;
    };
}

- (UILabel *(^)(NSTextAlignment))chianedTextAlignment {
    return ^UILabel *(NSTextAlignment textAlignment) {
        if (textAlignment) {self.textAlignment = textAlignment;}
        return self;
    };
}

- (UILabel *(^)(NSAttributedString *))chianedNSAttributedString {
    return ^UILabel *(NSAttributedString *attributedString) {
        if (attributedString) {self.attributedText = attributedString;}
        return self;
    };
}

- (UILabel *(^)(BOOL ,BOOL ))chainedLabelEnable {
    return ^UILabel *(BOOL enabled,BOOL userInteractionEnabled) {
        self.enabled = enabled;
        self.userInteractionEnabled = userInteractionEnabled;
        return self;
    };
}

- (UILabel *(^)(NSInteger))chainedLabelNumberOfLines {
    return ^UILabel *(NSInteger numberOfLines) {
        self.numberOfLines = numberOfLines;
        return self;
    };
}

- (UILabel *(^)(UIColor *,CGSize ))chainedLabelShadow {
    return ^UILabel *(UIColor * shadowColor,CGSize shadowOffset) {
        if (shadowColor) {self.shadowColor = shadowColor;}
        self.shadowOffset = shadowOffset;
        return self;
    };
}

#pragma mark - setter


- (void)setChianedTextSet:(UILabel *(^)(NSString *, UIColor *, UIFont *))chianedTextSet {}

- (void)setChianedTextAlignment:(UILabel *(^)(NSTextAlignment))chianedTextAlignment {}

- (void)setChianedNSAttributedString:(UILabel *(^)(NSAttributedString *))chianedNSAttributedString {}

- (void)setChainedLabelEnable:(UILabel *(^)(BOOL, BOOL))chainedLabelEnable {}

- (void)setChainedLabelNumberOfLines:(UILabel *(^)(NSInteger))chainedLabelNumberOfLines {}

- (void)setChainedLabelShadow:(UILabel *(^)(UIColor *, CGSize))chainedLabelShadow {}

@end
